import React from 'react';
import { HashRouter, Route, Switch } from 'react-router-dom';
import Login from './pages/login';
import App from './App';
import Admin from './admin';
import Buttons from './pages/ui/buttons';
import Modals from './pages/ui/modals';
import Loading from './pages/ui/loadings';
import NoMatch from './nomatch';
import Message from './pages/ui/message';
import FromLogin from './pages/form/login'

export default class IRouter extends React.Component {
    render() {
        return (
            <HashRouter>
                <App>
                    <Route path="/login" component={Login} />
                    <Route path="/admin" render={() =>
                        <Admin>
                            <Switch>
                                <Route path="/admin/ui/buttons" component={Buttons} />
                                <Route path="/admin/ui/modals" component={Modals} />
                                <Route path="/admin/ui/loading" component={Loading} />
                                <Route path="/admin/ui/message" component={Message} />
                                <Route path="/admin/from/login" component={FromLogin} />
                                <Route component={NoMatch} />
                            </Switch>
                        </Admin>
                    } />
                </App>
            </HashRouter>
        )
    }
}